package com.bluelight.struts2.examples.Service;

import com.bluelight.struts2.examples.dao.UserDAO;
import com.bluelight.struts2.examples.dao.UserMemoryDAO;
import com.bluelight.struts2.examples.entity.User;

public class UserService {
	private UserDAO userDao = new UserMemoryDAO();

	public UserService() {
	}

	public boolean validateUser(User userArg) {
		String password = userArg.getPassword();
		User user = this.userDao.findUserByUserId(userArg);
		if (null != user) {
			if (password.equals(user.getPassword()))
				return true;
		}
		
		return false;
	}

}
